﻿using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using System.Linq;
using System.Web;

namespace MovieReview.Models                         // dictates XML namespace, must match in service
{
    // a listing for a Movie
    public class MovieListing
    {
        // Movie name
        [Required(ErrorMessage = "Invalid Movie Name")]    // data validation
        public string MovieName
        {
            get;
            set;
        }

        // Movies rating
        [Range(0.00001, 9.99999, ErrorMessage = "Choose rating between 0-10")] // data validation
        public double Rating
        {
            get;
            set;
        }

        // Movies release date
        public DateTime ReleaseDate
        {
            get;
            set;
        }

        // Movies review
        [MaxLength(140, ErrorMessage = "Review too long")]
        public string Review
        {
            get;
            set;
        }

        // User or reviewer name
        [MaxLength(50, ErrorMessage = "Name is too long")]
        public string Reviewer
        {
            get;
            set;
        }
    }
}
